package com.zmn.mcc.services.interfaces.organize;

import com.zmn.common.dto.StatusDTO;
import com.zmn.mcc.model.entity.organize.McOrganize;
import com.zmn.mcc.model.entity.organize.McOrganizeQuery;

import java.util.List;

/**
 * @author heguanghua
 * @since 2020/04/14 13:45
 */
public interface OrganizeService {

    McOrganize findByKey(Integer orgId);

    List<McOrganize> listPageByQuery(McOrganizeQuery query);

    /**
     * 取得指定等级及以上的组织列表
     *
     * @param level  指定组织等级
     * @param status 状态
     * @return
     */
    List<McOrganize> listAboveByLevel(Integer level, Integer status);

    List<McOrganize> listByCompanyId(Integer companyId);

    List<McOrganize> listByCompanyId(Integer companyId, Integer status);

    List<McOrganize> listByCompanyId(Integer companyId, Integer type, Integer status);

    List<McOrganize> listByOrgIds(List<Integer> orgIds);

    List<McOrganize> listByOrgIds(List<Integer> orgIds, Integer status);

    List<McOrganize> listByParentId(Integer parentId);

    List<McOrganize> listByParentId(Integer parentId, Integer status);

    List<McOrganize> listByParentId(Integer parentId, Integer type, Integer status);

    List<McOrganize> listByQuery(McOrganizeQuery query);

    Integer countByQuery(McOrganizeQuery query);


    Integer updateByKey(McOrganize organize);

    Integer updateStatus(Integer orgId, Integer status, String updater);

    Integer updateStatus(McOrganize organize);

    Integer updateStatusBatch(List<Integer> orgIds, Integer status, String updater);

    Integer updateStatusBatch(StatusDTO dto);

    Integer updateSort(Integer orgId, Integer sort);

    Integer updateSort(McOrganize organize);


    Integer insert(McOrganize organize);


    Integer deleteByKey(Integer orgId);

    List<McOrganize> listValidOrgs();

    /**
     * 更新北森组织信息
     *
     * @param organize
     */
    void updateBsOrg(McOrganize organize);
}
